package com.shoppingmall.activity.mine;

import android.view.View;
import android.widget.TextView;

import com.example.zyh.toolslib.base.BaseActivity;
import com.example.zyh.toolslib.widget.TitleBar;
import com.shoppingmall.R;
import com.shoppingmall.adapter.AddressManagerAdapter;
import com.shoppingmall.bean.AddressBean;

import java.util.ArrayList;
import java.util.List;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.OnClick;

/**
 * 2020/3/8
 * 描述：地址管理
 */
public class AddressManageActivity extends BaseActivity {


    @BindView(R.id.title_bar)
    TitleBar titleBar;
    @BindView(R.id.rv_address)
    RecyclerView rvAddress;
    @BindView(R.id.tv_add_new_address)
    TextView tvAddNewAddress;

    private AddressManagerAdapter mAdapter;
    private List<AddressBean> mData = new ArrayList<>();

    @Override
    protected int initLayout() {
        return R.layout.activity_mine_address_manage;
    }

    @Override
    protected void initView() {
        titleBar.setLeftLayoutClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    @Override
    protected void initData() {
        for (int i = 0; i < 5; i++) {
            mData.add(new AddressBean());
        }
        mAdapter = new AddressManagerAdapter(mData);
        rvAddress.setLayoutManager(new LinearLayoutManager(mContext));
        rvAddress.setAdapter(mAdapter);
    }

    @Override
    protected void initEvent() {

    }

    @OnClick({R.id.tv_add_new_address})
    public void onViewClicked() {
    }

}
